# -*- coding: utf-8 -*-
# @Time     : 2023/12/9 20:45
# @Author   : JustFly
# @File     : conn_mysql.py
# @Software : PyCharm

from dotenv import load_dotenv
from config.db import DB_HOST, DB_NAME, DB_PASSWORD, DB_USERNAME, CA_FILE

load_dotenv()
import MySQLdb

connection = MySQLdb.connect(
    host=DB_HOST,
    user=DB_USERNAME,
    passwd=DB_PASSWORD,
    db=DB_NAME,
    autocommit=True,
    ssl_mode="VERIFY_IDENTITY",
    ssl={
        "ca": CA_FILE
    }
)

print(connection)

